/**
 * Solution.java
 */
package dateconversion;

import java.util.ArrayList;
import java.util.List;

/**
 * @author prakash
 *
 */
public class Solution2 {

	public static void main(String args[]) throws Exception {
		int[] array = { 1, 2, 3 };
		int b[] = new int[6];
		b[0] = 5;
		b[1] = 6;
		b[2] = 7;
		int bIndex = 3;
		int aIndex = 0;
		int M = 3;
		int count = 3;
		System.arraycopy(b, 0, b, bIndex, M - bIndex);
		System.arraycopy(array, aIndex, b, bIndex, count);
		System.out.println(array);
	}

	static int maxRounds(String s, String t) {
		int maxRounds = 0;
		int replaceStringSize = t.length();
		StringBuilder src = new StringBuilder(s);
		int index = -1;
		while ((index = src.indexOf(t)) != -1) {
			src.replace(index, index + replaceStringSize, "");
			maxRounds++;
		}
		return maxRounds;
	}

	static void mergeArray(int[] a, int[] b, int M) {
		int aIndex = 0, bIndex = 0;

		int startA = 0, startB = 0;
		for (aIndex = 0, bIndex = 0; aIndex < M && bIndex < 2 * M;) {
			int count = 0;
			startA = aIndex;
			startB = bIndex;
			while (a[aIndex] < b[bIndex]) {
				count++;
				aIndex++;
			}
			bIndex = startB + count;
			System.arraycopy(b, startB, b, startB + count, M - startB);
			System.arraycopy(a, startA, b, startB, count);
		}

	}

	static String[] romanizer(int[] num) {
		List<String> returnList = new ArrayList<String>();
		for (int eachNumber : num) {
			returnList.add(getRoman(eachNumber));
		}
		return returnList.toArray(new String[returnList.size()]);
	}

	enum Digit {
		M(1000, 3), CM(900, 1), D(500, 1), CD(400, 1), C(100, 3), XC(90, 1), L(50, 1), XL(40, 1), X(10, 3), IX(9, 1), V(
				5, 1), IV(4, 1), I(1, 3);

		public final int value;
		public final String symbol = name();
		public final int maxArity;

		private Digit(int value, int maxArity) {
			this.value = value;
			this.maxArity = maxArity;
		}
	}

	static String getRoman(int number) {
		if (number < 1 || 3999 < number) {
			throw new IllegalArgumentException(String.format(
					"Roman numbers are only defined for numbers between 1 and 3999 (%d was given)", number));
		}

		StringBuilder sb = new StringBuilder();
		for (Digit digit : Digit.values()) {
			int value = digit.value;
			String symbol = digit.symbol;

			while (number >= value) {
				sb.append(symbol);
				number -= value;
			}
		}

		return sb.toString();

	}
}